package com.app.gson;

import java.lang.reflect.Type;
import java.util.Calendar;

import com.app.util.Util;
import com.google.gson.JsonElement;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

public class CalendarSerializer implements JsonSerializer < Calendar > {

    @Override
    public JsonElement serialize(Calendar c, Type arg1,
	    JsonSerializationContext arg2) {
	return new JsonPrimitive(Util.dateToString(c.getTime(), Util.FORMAT_DATE_JSON));
    }


}
